<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 全局过滤器</title>
    <script src="../../vue文件/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>{{ msg | f1 }}</p>
        <h1 :title="msg | f2">sss</h1>
        <p>{{ msg | f1 | f3}}</p>
        
    </div>
</body>
<script>
    // Vue.filter(id,function)
    Vue.filter("f1",function(text){
        console.log("aa");
        console.log(text);
        return text.replace('ll','hahah')
    })
    Vue.filter("f2",function(text){
        console.log("aa");
        console.log(text);
        return text.replace('ll','hahah')
    })
    Vue.filter("f3",function(text){
        console.log("aa");
        console.log(text);
        return text+"----"
       
    })

    let vm = new Vue({
        el:'#app',
        data:{
            msg:'hello'
        }
    })
</script>
</html>